<?php
$this->breadcrumbs = array(
    'Assessment Report' => array('/AssesmentReport'),
    'Assessmentreport',
);
?>
<h1>
<?php echo $this->id . '/' . $this->action->id; ?></h1>
<br><br>
<table class="items">
		<tr>
			<th>COMP UNIT NAME</th>
			<th>COMP ELEM NAME</th>
			<th>COMP LIB NAME</th>
			<th>COMP LIB CODE</th>
			<!--th>JLR</th>
			<th>LEVEL ACHIEVED</th>
			<th>COLOR</th-->
			<th colspan="4">LEVEL</th>
		</tr>
	<tbody>		
<?php 
//Array 
//( [comp_unit_name] => IT [comp_elem_name] => Office Support [comp_lib_name] => Ms Office [comp_lib_code] => CU00100100 [jlr] => 2 [level_achieved] => 1 [color] => yellow ) 
//$this->widget('zii.widgets.grid.CGridView', array('dataProvider'=>$dataReport,)); 
//print_r($dataReport);
foreach($dataReport["report"] as $i=>$row)
{
	$chart = array(
				array(array($row['level_passed'],$i)), 
				array(array($row['jlr'],$i)), 
			);

	echo '
		<tr>
			<td>'.$row['comp_unit_name'].'</td>
			<td>'.$row['comp_elem_name'].'</td>
			<td>'.$row['comp_lib_name'].'</td>
			<td>'.$i.'</td>
			<td>';
$this->widget('application.extensions.jqplot.JqplotGraphWidget', 
    array(
        'data'=>$chart,
        'options'=>array(
				'seriesColors'=>array($row['color'],'lightblue'),
                'seriesDefaults'=>array(
                    'renderer'=>'js:$.jqplot.BarRenderer',
                    'rendererOptions'=>array('barDirection'=>'horizontal', 'barMargin'=>1, 'barPadding'=>1),
					'shadow'=>false,
                ),
                'axes'=>array(
                    'yaxis'=>array(
						'renderer'=>'js:$.jqplot.CategoryAxisRenderer',
						'min'=> 0,
						'show'=>false
					),

					'xaxis'=>array(
						'min'=> 0,
						'max'=>4,
						'numberTicks'=>5
					),
                ),
        ),
        'htmlOptions'=>array(
               'style'=>'width:200px;height:50px;'
        ),
        'pluginScriptFile'=>array(
            //'jqplot.dateAxisRenderer.js',
            'jqplot.pointLabels.js',
            'jqplot.barRenderer.js',
            'jqplot.categoryAxisRenderer.js')
    )
);

			echo '</td>
		</tr>			
	';
	
}
?>
	</tbody>
</table>
<?php
/*
$this->widget('application.extensions.jqplot.JqplotGraphWidget', 
    array(
        'data'=>$data,
        'options'=>array(
                'seriesDefaults'=>array(
                    'renderer'=>'js:$.jqplot.BarRenderer',
                    'rendererOptions'=>array('barDirection'=>'horizontal'),
					//'shadowAngle'=>0,
                ),
                'axes'=>array(
                    'yaxis'=>array(
						'renderer'=>'js:$.jqplot.CategoryAxisRenderer',
						'min'=> 0,
					),

					'xaxis'=>array(
						'min'=> 0,
						'max'=>4,
						'numberTicks'=>5
					),
                ),
        ),
        'htmlOptions'=>array(
               'style'=>'width:200px;height:100px;'
        ),
        'pluginScriptFile'=>array(
            //'jqplot.dateAxisRenderer.js',
            'jqplot.pointLabels.js',
            'jqplot.barRenderer.js',
            'jqplot.categoryAxisRenderer.js')
    )
);

*/
?>